package com.totoro.motan.config;

import com.weibo.api.motan.config.ProtocolConfig;
import com.weibo.api.motan.config.RegistryConfig;
import com.weibo.api.motan.config.springsupport.AnnotationBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MotanConfig {
    @Bean
    @ConfigurationProperties(prefix = "motan.annotation")
    public AnnotationBean annotationBean(){
        AnnotationBean annotationBean = new AnnotationBean();
        return annotationBean;
    }

    @Bean(name = "motan")
    @ConfigurationProperties(prefix = "motan.protocol")
    public ProtocolConfig protocolConfig(){
        ProtocolConfig protocolConfig = new ProtocolConfig();
        return protocolConfig;
    }

    @Bean()
    @ConfigurationProperties(prefix = "motan.registry")
    public RegistryConfig registryConfig(){
        RegistryConfig registryConfig = new RegistryConfig();
        return registryConfig;
    }
}
